import org.junit.Test;

/**
 * class description
 *
 * @author 朱宗刚
 * @version 1.0.0
 * @date 2020/10/19
 */

public class ReplaceString {
    @Test
    public void test001() {
        String val = "3.3岁";
        System.out.println(val.replaceAll("[^(-|\\\\+)?(\\\\d+)*.?\\\\d+]", ""));
        System.out.println(val.replaceAll("[^\\d+]", ""));
    }
}
